package Utils

object testDemo2 {



  val session = SparkSessionSingleton.getInstance(null)
//  println(session.version)
//  println(session.sparkContext.appName)

  val sessionSyn = SparkSessionSingleton.getInstanceWithSync(null)
  println(s"In this ${this.getClass.getName} file: ${sessionSyn.version}")
  println(s"In this ${this.getClass.getName} file: ${sessionSyn.sparkContext.appName}")

  def testSSSobj() = {
    println(s"Test whether different objects  get the same sparkSession \nusing " +
      s"singleton object: ${testDemo.session.equals(testDemo2.session)}")

    println(s"Test whether different objects  get the same sparkSession \nusing " +
      s"syn singleton object: ${testDemo.sessionSyn.equals(testDemo2.sessionSyn)}")
  }

  def testDFcreation() = {
    dfCreation.personDF.show(false)
  }

  def main(args: Array[String]): Unit = {
//    testSSSobj()
    testDFcreation()
  }



}
